package com.mew.common.enm;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;


public enum PlanType {
    Blood(1, "正常波"),
    Small(2, "小波"),
    Big(3, "大波")
    ;

    private final static Map<Integer, PlanType> stateMap
            = Arrays.stream(PlanType.values()).collect(Collectors.toMap(PlanType::code, code -> code));

    private final int code;
    private final String desc;


    PlanType(final int code, final String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int code() {
        return this.code;
    }


    public static PlanType parse(int code) {
        return stateMap.get(code);
    }

    public String desc(){
        return this.desc;
    }
}
